package com.gmrz.uaf.protocol.v1.schema;

import com.gmrz.uaf.common.Constants;

import java.sql.Timestamp;

/**
 * Created by chentaikun on 16/12/26.
 */
public class FidoLog {

    private String id;
    private String transNo;
    private String appID;
    private String authType;
    private String userName;
    private String request;
    private String response;
    private int operType;
    private String operError;
    private int operCode;
    private String localIP;
    private String remoteIP;
    private Timestamp createts;
    private String transType;



    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public String getAppID() {
        return appID;
    }

    public void setAppID(String appID) {
        this.appID = appID;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getOperType() {
        return operType;
    }

    public void setOperType(int operType) {
        this.operType = operType;
    }

    public String getOperError() {
        return operError;
    }

    public void setOperError(String operError) {
        this.operError = operError;
    }

    public int getOperCode() {
        return operCode;
    }

    public void setOperCode(int operCode) {
        this.operCode = operCode;
    }

    public String getLocalIP() {
        return localIP;
    }

    public void setLocalIP(String localIP) {
        this.localIP = localIP;
    }

    public String getRemoteIP() {
        return remoteIP;
    }

    public void setRemoteIP(String remoteIP) {
        this.remoteIP = remoteIP;
    }

    public Timestamp getCreatets() {
        return createts;
    }

    public void setCreatets(Timestamp createts) {
        this.createts = createts;
    }

    public String getRequest() {
        return request;
    }

    public void setRequest(String request) {
        this.request = request;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public String getAuthType() {
        return authType;
    }

    public void setAuthType(String authType) {
        this.authType = authType;
    }

    public String getTransType() {
        return transType;
    }

    public void setTransType(String transType) {
        this.transType = transType;
    }

    public String toString(){
        StringBuilder builder = new StringBuilder();
        builder.append("fidoLog.id=").append(id)
                .append("fidoLog.appID=").append(appID)
                .append("fidoLog.userName=").append(userName)
                .append("fidoLog.authType=").append(authType)
                .append("fidoLog.transType=").append(transType)
                .append("fidoLog.operType=").append(Constants.Method.forMethodByOperType(operType).getMethodName())
                .append("fidoLog.operCode=").append(operCode)
                .append("fidoLog.operError=").append(operError)
                .append("fidoLog.remoteIP=").append(remoteIP)
                .append("\nfidolog.request=").append(request)
                .append("\nfidoLog.response=").append(response);
        return builder.toString();
    }

}